home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / IM_3.adf / Exec / piarc.LZH / tess.rexx < prev    next >
OS/2 REXX Batch file  |  1992-02-29  |  2KB  |  91 lines

  1. /*
  2.  * TESS.rexx   ( calls the TESSELLATE command )
  3.  *
  4.  *  Written by: Barry Chalmers and Ben Williams
  5.  * Last Update: December 11th, 1991
  6.  *    Revision: 1.01
  7.  *         For: Black Belt Systems image processing series IM, IM F/c, and IP.
  8.  */
  9.  
  10. /*
  11.  * open rexxsupport.library -- needed for some functions
  12.  */
  13. if ~show('L',"rexxsupport.library") then do
  14.   if addlib('rexxsupport.library',0,-30,0) then do
  15.       /* everything's ok */
  16.     end;
  17.   else do
  18.     say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
  19.     say 'Cannot operate this module without the library - sorry!';
  20.     exit 10;
  21.     end;
  22.   end;
  23.  
  24. /*
  25.  * This will automatically direct the script to the proper
  26.  * software, if it is running. No matter where the script is
  27.  * launched from. :^) I sure do like ARexx. :^))
  28.  */
  29. prtnme = 'IP_Port'; /* assume Image Professional */
  30. if show('P','IP_Port') = 0 then do
  31.   if show('P','IM_Port') = 0 then do
  32.     say "Can't find image processor's ARexx port!!!"; /* not running? */
  33.     say "This script requires IP, IM or IM F/c to run!";
  34.     exit(20);
  35.     end;
  36.   else do
  37.     prtnme = 'IM_Port'; /* That's the thing about assumptions... */
  38.     end;                 /* We make em, user's break em.          */
  39.   end;
  40. address(prtnme);
  41.  
  42.   /*
  43.    * This code attempts to read a file called "picmdpath" from REXX:
  44.    * If it can't find it, the script will assume that the commands
  45.    * associated with this PI Module are in "c:". If the file exists,
  46.    * the script will look in the path that is specified in the file.
  47.    * If you create this file, you MUST put a complete, correct path
  48.    * in it; if the commands are in a sub-directory, you have to put
  49.    * the trailing slash on the path (like, device:dir/).
  50.    * 
  51.    */
  52.   cmdpath = 'c:';
  53.   if open(fhandle,'rexx:picmdpath','read') then  /* open the file */
  54.     do
  55.       cmdpath = readln(fhandle);
  56.       call close(fhandle);  /* close the file    */
  57.     end
  58.  
  59. 'tofront';
  60.  
  61. 'fchide';
  62. options results;
  63. 'askprop "Triangle edge:" 20 1 200';
  64. edge = result;
  65. options;
  66.  
  67. 'backuptoundo';
  68. 'area';
  69.  
  70. options results;
  71. 'jackin';
  72. jack = result;
  73. 'current';
  74. bufdata = result;
  75. options;
  76. parse var bufdata bname ',' bnum ',' brest
  77.  
  78. 'lockimage '||bnum;
  79. address command cmdpath||'tessellate '||jack||' '||edge;
  80. 'unlockimage '||bnum;
  81.  
  82. address(prtnme);
  83.  
  84. 'tofront';
  85. 'fcshow';
  86. 'redraw';
  87.  
  88. address;
  89.  
  90. exit 0;
  91.